var bg = {
    init: function(){
        chrome.extension.onRequest.addListener(this.onContentScriptMessage);
    },
    onContentScriptMessage: function(request, sender, sendResponse) {
        switch(request.event){
            case EVENT.DOWNLOAD_ALBUM:
                $.each(request.songs, function(index, song){
                    chrome.tabs.create({url: song.url});
                });
                break;
            case EVENT.DOWNLOAD_SONG:
                chrome.tabs.create({url: request.song.url});
                break;
        }
        
//        console.log(request, sender, sendResponse);
    }
    
};

bg.init();